import React from "react";
class FormTest extends React.Component {
  state = {
    txt: '111',
    city: 'sh'
  }
  handleText = (e) => {
    this.setState({
      txt : e.target.value
    })
  }
  handleCity= (e) => {
    this.setState({
      city: e.target.value
    })
  }
  render() {
    return (
      <div>
        <input type="text" value={this.state.txt} onChange={this.handleText} />
        <select value={this.state.city} onChange={this.handleCity}>
                    <option value='sh'>上海</option>
                    <option value='bj'>北京</option>
                    <option value='gz'>广州</option>
                </select>
      </div>
    )
  }
}

export default FormTest